<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<title>DelphiWebMVC</title>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" href="/swagger/element-ui/index.css">
	<link rel="stylesheet" href="/swagger/element-ui/display.css">
	<link rel="stylesheet" href="/swagger/element-ui/main.css">
	<script src="/swagger/element-ui/vue.js"></script>
	<script src="/swagger/element-ui/index.js"></script>
	<script src="/swagger/element-ui/vue-resource.min.js"></script>
</head>
<style>a{ text-decoration:none}</style>
<div id="app" style="text-align: left;">
	<div style="margin-top: 10px;"></div>
	<h1>DelphiWebMVC-swagger</h1>
	<div v-for="(item,index) in data">
		<h2>{{item.Route}}</h2>
		<el-collapse v-model="openeds" @change="handleChange" style="overflow: none;">
			<el-collapse-item  v-for="(item2,index) in item.Body" :key="index">
				<template #title>
				<span>{{item2.HttpMethod}} </span>	<span style="margin-left: 4px;">{{item2.Url}}</span>
				</template>
				<div >
					<div>
						路由参数:{{item2.UrlParam}}

					</div>
					<div>
						请求数据: <span v-if="item2.Request===''"> 无</span>
						<div v-if="item2.Request!==''" style="border: 1px solid #98bf21;width: 50%; 
						border-radius: 4px;overflow: auto; ">
						<el-input  v-model="item2.Request" :rows="10" type="textarea"  />
						 <!-- {{ item2.Request }} -->
						</div>

			
					</div>
					<div>
						返回数据: <span v-if="item2.Response===''"> 无</span>
						<div v-if="item2.Response!==''" style=" border: 1px solid #98bf21;width: 50%; 
						border-radius: 4px;overflow: auto; ">
						<el-input  v-model="item2.Response" :rows="10" type="textarea"  />
			
						</div>
						
					</div>
				</div>
			</el-collapse-item>
			</el-collapse>
	</div>


    <div style="margin-top: 10px;"></div>
</div>
<script>
new Vue({
	el:"#app",
	created(){
		document.title=this.title	
		this.getdata();
	},
	mounted(){

	},
	data:{
		title:"swagger",
		data:[],
		openeds:true,
	},
	methods:{
		handleChange(){

		},
		getdata:function(){
			let that=this
			this.$http.get("/swagger/getdata").then(ret=>{
				that.data=ret.data
			});
			
		},
	}
	
});
</script>

</html>